/*
 * LDIR
 * 
 * LDIR, a GPS cartography application built for Let's Do It Romania eco 
 * campaign.
 * Copyright (C) 2010 Genera Software <office@generasoftware.com>
 * 
 * http://generasoftware.com/
 * 
 * This program is free software; you can redistribute it and/or modify it under
 * the terms of the GNU General Public License as published by the Free Software
 * Foundation; either version 2 of the License, or (at your option) any later
 * version.
 * 
 * This program is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
 * details.
 * 
 * You should have received a copy of the GNU General Public License along with
 * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
 * Place, Suite 330, Boston, MA 02111-1307 USA
 */
 
/**
 *    Generated helper class which manages the settings contained 
 *    in 'LDIRSettings'.  Each CAknSettingItem maintains
 *    a reference to data in this class so that changes in the setting
 *    item list can be synchronized with this storage.
 */
 
#include <e32base.h>
#include <stringloader.h>
#include <barsread.h>
#include <LDIR.rsg>
#include "LDIRSettingsSettings.h"

/**
 * C/C++ constructor for settings data, cannot throw
 */
TLDIRSettingsSettings::TLDIRSettingsSettings()
    {
    }

/**
 * Two-phase constructor for settings data
 */
TLDIRSettingsSettings* TLDIRSettingsSettings::NewL()
    {
    TLDIRSettingsSettings* data = new( ELeave ) TLDIRSettingsSettings;
    CleanupStack::PushL( data );
    data->ConstructL();
    CleanupStack::Pop( data );
    return data;
    }
    
/**
 *    Second phase for initializing settings data
 */
void TLDIRSettingsSettings::ConstructL()
    {
        {
        HBufC* text = StringLoader::LoadLC( R_LDIRSETTINGS_EDIT1 );
        SetEdit1( text->Des() );
        CleanupStack::PopAndDestroy( text );
        }
    SetEnumeratedTextPopup1( 0 );
    SetBinarySetting1( 0 );
    SetIntegerEditor1( 0 );
    }
    
// [[[ begin generated region: do not modify [Generated Contents]
TDes& TLDIRSettingsSettings::Edit1()
    {
    return iEdit1;
    }

void TLDIRSettingsSettings::SetEdit1(const TDesC& aValue)
    {
    if ( aValue.Length() < KEdit1MaxLength)
        iEdit1.Copy( aValue );
    else
        iEdit1.Copy( aValue.Ptr(), KEdit1MaxLength);
    }

TDes& TLDIRSettingsSettings::Secret1()
    {
    return iSecret1;
    }

void TLDIRSettingsSettings::SetSecret1(const TDesC& aValue)
    {
    if ( aValue.Length() < KSecret1MaxLength)
        iSecret1.Copy( aValue );
    else
        iSecret1.Copy( aValue.Ptr(), KSecret1MaxLength);
    }

TInt& TLDIRSettingsSettings::EnumeratedTextPopup1()
    {
    return iEnumeratedTextPopup1;
    }

void TLDIRSettingsSettings::SetEnumeratedTextPopup1(const TInt& aValue)
    {
    iEnumeratedTextPopup1 = aValue;
    }

TBool& TLDIRSettingsSettings::BinarySetting1()
    {
    return iBinarySetting1;
    }

void TLDIRSettingsSettings::SetBinarySetting1(const TBool& aValue)
    {
    iBinarySetting1 = aValue;
    }

TInt& TLDIRSettingsSettings::IntegerEditor1()
    {
    return iIntegerEditor1;
    }

void TLDIRSettingsSettings::SetIntegerEditor1(const TInt& aValue)
    {
    iIntegerEditor1 = aValue;
    }
